﻿<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>生产质检</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <!--responsive-->
    <link rel="shortcut icon" href="../Content/img/jridge.ico" />
    <link rel="bookmark" href="../Content/img/jridge.ico" />
    <script src="../Scripts/jquery-1.10.2.min.js"></script>
    <script src="../Scripts/clipboard-polyfill.js"></script>
    <!--公共样式-->
    <link rel="stylesheet" href="./content/index.css">
    <!--vue-->
    <script src="../Scripts/vue-2.5.9/vue.min.js"></script>
    <!--axios-->
    <script src="../Scripts/vue-2.5.9/axios.min.js"></script>
    <!--elementUI-->
    <script src="./Scripts/elementUI-2.4.0/index.js"></script>
    <link rel="stylesheet" href="./Scripts/elementUI-2.4.0/theme-chalk/index.css">
    <!--custom-->
    <link rel="stylesheet" href="../Content/vue-common.css">
    <script src="./Scripts/vue-service-school.js"></script>
    <script src="../Scripts/service/vue-service.js"></script>
    <style>
        .el-table .success-row {
            background: #f0f9eb;
        }
    </style>
</head>

<body id="body">
    <div id="app">
        <header-bar :pagename="pagename" :userinfo="userinfo"></header-bar>
        <el-row>
            <el-col :span="3">
                <side-bar></side-bar>
            </el-col>
            <el-col :span="21">
                <div id="container">
                    <el-row style="margin-top:10px">
                        <el-col :span="10" :offset="1">
                            <span style="font-family:'幼圆'">当前订单：</span>
                            <el-select v-model="selectedOrderID" placeholder="请选择一个订单质检" size="small" @change="selectOrder()">
                                <el-option v-for="item in orderData" :key="item.id" :label="item.properties.name" :value="item.id">
                                    <span style="float: left">{{ item.properties.orderno }}</span>
                                    <span style="float: right; color: #8492a6; font-size: 13px">{{ item.properties.name }}</span>
                                </el-option>
                            </el-select>
                        </el-col>
                        <el-col :span="12">
                            <span style="float:right;font-size:14px;color:#666666;margin:10px auto auto 10px">
                                <i class="el-icon-info" style="margin-right:10px;"></i>当前订单下 共计
                                <span style="color:#409EFF">{{inspectiondataLength}}</span> 条可报工单</span>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-table :data="inspectionData" style="width: 96%;margin-left:3%" border :max-height="mainTable_maxHeight" :height="mainTable_maxHeight"
                            v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
                            <el-table-column type="index" label="序号" width="58" align="center"></el-table-column>
                            <el-table-column prop="productname" label="产品名称" width="100" align="center"></el-table-column>
                            <el-table-column prop="plmpartname" label="零件名称" width="100" align="center"></el-table-column>
                            <el-table-column prop="processno" label="工序号" width="80" align="center"></el-table-column>
                            <el-table-column prop="qcpname" label="工序名称" width="80" align="center"></el-table-column>
                            <el-table-column prop="materialno" label="物料编码" width="120" align="center"></el-table-column>
                            <el-table-column prop="identityno" label="图号" width="120" align="center"></el-table-column>
                            <el-table-column prop="assignquantity" label="计划数量" width="70" align="center"></el-table-column>
                            <el-table-column prop="realquantity" label="报工数量" width="70" align="center"></el-table-column>
                            <el-table-column prop="reporter" label="报工人" width="90" align="center"></el-table-column>
                            <el-table-column label="报工时间" sortable width="110" align="center">
                                <template scope="scope">
                                    <i class="el-icon-time"></i>
                                    <span style="margin-left: 2px">{{ scope.row.reporttime }}</span>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作" width="120" fixed="right" align="center">
                                <template slot-scope="scope">
                                    <el-button @click="inspect(scope.$index,scope.row)" type="success" size="mini" icon="el-icon-document">质检</el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-row>
                </div>
            </el-col>
        </el-row>

        <!--质检填写弹出框-->
        <el-dialog title="质检" class="md_dialog_900" :visible.sync="inspectionDialog" :row-class-name="tableRowClassName" :close-on-click-modal="false"
            :close-on-press-escape="false">
            <el-row>
                <el-col :span="20" :offset="2">
                    <el-form :inline="true">
                        <el-col span="12">
                            <el-form-item label="报工数量" label-position="left" label-width="120px">
                                <el-input v-model="inspect_row.realquantity" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col span="12">
                            <el-form-item label="合格数量" label-position="left" label-width="120px">
                                <el-input v-model="inspect_row.firstquantity" :disabled="true"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-form>
                </el-col>
            </el-row>
            <el-row class="write_area">
                <el-col :span="20" :offset="2">
                    <el-form :inline="true">
                        <el-col :span="12">
                            <el-form-item label="总不良数量" label-position="left" label-width="120px">
                                <el-input v-model="rejectsquantity"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-form>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="20" :offset="2">
                    <el-form :inline="true" style="margin-top:16px;padding-top:10px;border:1px dashed #ddd;border-radius:10px" class="self_formLabel_90 center"
                        v-for="(list,index) in inspect_row.unqualifiedArray">
                        <el-col :span="12">
                            <el-form-item label="不良数量" label-position="left" label-width="120px">
                                <el-input v-model="list.properties.repairquantity"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="现象" label-position="left" label-width="120px">
                                <el-select v-model="list.properties.repairreason" placeholder="请选择" class="select_write" @blur="select_write_fn(event,list)">
                                    <el-option v-for="defect in inspect_row.defect_items" :key="defect.id" :label="defect.properties.name" :value="defect.properties.name"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="描述" label-position="left" label-width="120px">
                                <el-input type="text" v-model="list.properties.description"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12" class="hidden-md-and-up">
                            <el-button type="danger" size="small" icon="el-icon-delete" style="float:right;margin:auto 25px 2px auto" @click="deleteList(index)">删除该条不合格原因</el-button>
                        </el-col>
                    </el-form>
                </el-col>


            </el-row>

            <span slot="footer" class="dialog-footer">
                <el-row>
                    <el-button icon="el-icon-circle-plus" type="primary" @click="addUnqualifiedList" size="mini">添加</el-button>
                    <el-button @click="inspectionDialog = false" size="mini">关闭</el-button>
                    <el-button type="success" @click="submitInspection" size="mini">质检</el-button>
                </el-row>
            </span>
        </el-dialog>


    </div>
    <script>
        $('#body').css('height', $(window).height());
        $('#container').css('height', $(window).height() - 80);
    </script>
    <script src="inspection.js"></script>
    <script src="./Template/vue-components.js"></script>
</body>

</html>